<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
{% load i18n %}
{% load users_tags %}
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>{{ shop.name_shop }} {% trans "Store" %}</title>
        
        <link rel="stylesheet" href="{{ MEDIA_URL }}css/960_20.css" />
        <link rel="stylesheet" href="{{ MEDIA_URL }}css/style.css" />
        <link rel="stylesheet" href="{{ MEDIA_URL }}css/buttons.css" />
        <link rel="stylesheet" href="{{ MEDIA_URL }}css/anytimec.css" />

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>

		{% block dont_use_validate %}        
	        <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js"></script>
        {% endblock %}
        
		<script src="{{ MEDIA_URL }}js/imgpreview.js" type="text/javascript"></script>
		<script src="{{ MEDIA_URL }}js/utils.js" type="text/javascript"></script>
		<script src="{{ MEDIA_URL }}js/anytimec.js" type="text/javascript"></script>
		<script src="{{ MEDIA_URL }}js/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
		
		<link rel="stylesheet" href="{{ MEDIA_URL }}css/jquery.treeview.css" />
		<script src="{{ MEDIA_URL }}js/jquery.treeview.min.js" type="text/javascript"></script>
		
		<link rel="stylesheet" href="{{ MEDIA_URL }}js/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
		
		{% block jquery-file-upload %}
		{% endblock %}
		
    </head>
    
	<body>

		<script type="text/javascript">
			$(function() {
				$("#tree").treeview({
					collapsed: false,
					animated: "medium",
					persist: "location"
				});
			})
			
			function show_help_text(id){
				$("."+id).show();
			}
			
			function close_help_text(id){
				$("."+id).hide();
			}
			
	 	</script>
	 	
		<script type="text/javascript">
			$(document).ready(function() {
				$("#actions_menu").hide();
				$("#gear").click(function(){
					$("#actions_menu").toggle("fast");
				});
				$("#actions_menu").click(function(){
					$(this).hide();	
				});			

				$(".enable_feature_box").fancybox({
					'width'				: '6',
					'height'			: '5',
					'autoScale'			: false,
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'type'				: 'iframe',					
					'onClosed'			: function() {	window.location = window.location;   },
					'onComplete'		: function() { $.fancybox.hideActivity(); }
				});
				
				$(".enable_feature_box").click(function(){
		        	$.fancybox.showActivity();
		        	return false;
		    	});
		    	
		    	close_help_text("htb_container");		    	
			});
		</script>
		
		{% block tinyMCE %}
			<script type="text/javascript" src="{{ MEDIA_URL_OUT_S3 }}js/tiny_mce/tiny_mce.js"></script>
			<!-- <script type="text/javascript" src="{{ MEDIA_URL_OUT_S3 }}js/tiny_mce/default_textareas.js"></script> -->
			<script type="text/javascript" src="{% url tinymce-js "default" %}"></script>
		{% endblock %}

		<div class="container_20">

		<!-- HEADER -->
					
			<div class="header">
				<div class="title">
					<div class="grid_8 padding_h">
						<a href="{% url back_to_site %}">
						<h1>
						{% if user.is_superuser %}
							{% trans "Admin Shop" %}
						{% else %}
							{{ shop.name_shop }} {% trans "Store" %}
						{% endif %}
						</h1>
						</a>
					</div>
					
					<div class="grid_11 welcome">
						<span>Welcome <b>{{ shop.admin.get_full_name }}</b><div class="separator">&nbsp;</div>
						<a href="{% url back_to_site %}">{% trans "Back to Site" %}</a><div class="separator">&nbsp;</div>		 
						<a href="">{% trans "About" %}</a><div class="separator">&nbsp;</div>
						<a href="">{% trans "Contact" %}</a><div class="separator">&nbsp;</div>
						{% if shop|is_owner:user %}
							<a href="{% url logout %}">{% trans "Logout" %}</a>
						{% else %}
							<a href="{% url login %}">{% trans "Login" %}</a>
						{% endif %}
						</span>
					</div>
				</div>
				<div class="clear"></div>
				
			</div>
			
			<div class="menu grid_20 alpha omega">
			{% if user.is_superuser %}
				<a href="{% url shop_list %}">{% trans "Shops" %}</a>
			{% else %}
				{% if user|is_admin_shop:shop %}
					<div class="grid_6 prefix_13">
						<ul>
							<li class="link_menu {% block m_account %}{% endblock %}"><a href="{% url account %}">{% trans "Account" %}</a></li>
							<li class="link_menu {% block m_preferences %}{% endblock %}"><a href="{% url preferences %}">{% trans "Preferences" %}</a></li>
						</ul>
					</div>
					
					<div class="clear"></div>
				{% endif %}
			{% endif %}
			</div>
			<div class="clear"></div>
			
			<!-- BODY -->

			<div class="body_container">
						
				<div class="menu_body">
					<div class="grid_1">
						<a href="{% block arrow_left %}{% url web_store %}{% endblock %}" class="arrow"><img src="{{ MEDIA_URL }}img/left.png"/></a>
						<a href="{% block arrow_right %}{% url home_admin %}{% endblock %}" class="arrow"><img src="{{ MEDIA_URL }}img/right.png"/></a>
					</div>
					<ul>
						<li class="link_menu {% block m_home %}{% endblock %}" id="home_button">
							<a href="{% url home_admin %}"><div class="grid_2 alpha omega"><img src="{{ MEDIA_URL }}img/home.png"/><span class="home_button">{% trans "Home" %}</span></div></a>
						</li>
						<li class="link_menu inner {% block m_customers %}{% endblock %}">
							<a href="{% url customers %}"><div class="grid_2 alpha omega">{% trans "Customers" %}</div></a>
						</li>
						<li class="link_menu inner {% block m_inventory %}{% endblock %}">
							<a href="{% url inventory %}"><div class="grid_2 alpha omega">{% trans "Inventory" %}</div></a>
						</li>
						<li class="link_menu inner {% block m_web_store %}{% endblock %}">
							<a href="{% url web_store %}"><div class="grid_2 alpha omega">{% trans "Web Store" %}</div></a>
						</li>
						<li class="link_menu inner {% block m_support %}{% endblock %}">
							<a href="{% url support %}"><div class="grid_2 alpha omega">{% trans "Support" %}</div></a>
						</li>
					</ul>
					
				</div>
				<div class="clear"></div>
				
				<!-- TODO: change style  -->
				{% if user.is_authenticated %}
					{% if flash.message %}
				        <div id="flash_message">
					        <div class="body {{ flash.severity|default:'notice' }}">
					        	<p>{{ flash.message|safe }}</p>
					        </div>
				        </div>
			    	{% endif %}				
				{% endif %}

				{% block body %}
					<div class="grid_3 alpha omega menu_left">
						<h3 class="title">{% block title_menu_left %}{% endblock %}</h3>
						<div class="menu_options">
						{% block menu_options %}
						{% endblock %}
						</div>
					</div>
					<div class="body_container_right">
						{% block body_right %}
							<div class="grid_16 alpha omega sub_menu">
								<div class="title_submenu">
									<div class="grid_11"><h2>{% block title_sub_menu %}{% endblock %}&nbsp;</h2></div>
									<div class="grid_4">{% block submenu_extra_text %}{% endblock %}</div>
								</div>
								{% block sub_menu %}
								{% endblock %}
							</div>	
							<div class="clear"></div>
	
							<div class="toolbar">
							{% block toolbar %}

								<div class="action">
									{% block action %}
									{% endblock %}
								</div>

								<div class="menu_tab">
									{% block tab %}
									{% endblock %}
								</div>	
								{% block search %}
								{% endblock %}

							{% endblock %}
							</div>
	
							{% block super_main %}
								<div class="main">							
								{% block main %}
									
								{% endblock %}
								</div>
							{% endblock %}
						{% endblock %}
					</div>
					<div class="clear"></div>
				{% endblock %}
			</div>
		</div>

		<!--  FOOTER -->			

		<div class="footer">
			<div class="container_20">
				<span>{% trans "Powered by" %} {{ shop.marketplace.name|cut:" "}}.com</span>
			</div>
		</div>
    </body>
</html>
